{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Introduction\n",
    "\n",
    "\n",
    "Reinforcement Learning (RL) is one of the areas of Machine Learning (ML). Unlike\n",
    "other ML paradigms, such as supervised and unsupervised learning, RL works in a\n",
    "trial and error fashion by interacting with its environment.\n",
    "\n",
    "RL is one of the most active areas of research in artificial intelligence, and it is\n",
    "believed that RL will take us a step closer towards achieving artificial general\n",
    "intelligence. RL has evolved rapidly in the past few years with a wide variety of\n",
    "applications ranging from building a recommendation system to self-driving cars.\n",
    "The major reason for this evolution is the advent of deep reinforcement learning,\n",
    "which is a combination of deep learning and RL. With the emergence of new RL\n",
    "algorithms and libraries, RL is clearly one of the most promising areas of ML.\n",
    "\n",
    "In this chapter, we will build a strong foundation in RL by exploring several\n",
    "important and fundamental concepts involved in RL. In this chapter, we will learn about the following topics:\n",
    "\n",
    "* Key elements of RL\n",
    "* The basic idea of RL\n",
    "* The RL algorithm\n",
    "* How RL differs from other ML paradigms\n",
    "* The Markov Decision Processes\n",
    "* Fundamental concepts of RL\n",
    "* Applications of RL\n",
    "* RL glossary\n",
    "\n",
    "We will begin the chapter by understanding Key elements of RL. This will help us understand the\n",
    "basic idea of RL."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Key Elements of Reinforcement Learning \n",
    "\n",
    "Let's begin by understanding some key elements of RL.\n",
    "\n",
    "## Agent \n",
    "\n",
    "An agent is a software program that learns to make intelligent decisions. We can\n",
    "say that an agent is a learner in the RL setting. For instance, a chess player can be\n",
    "considered an agent since the player learns to make the best moves (decisions) to win\n",
    "the game. Similarly, Mario in a Super Mario Bros video game can be considered an\n",
    "agent since Mario explores the game and learns to make the best moves in the game.\n",
    "\n",
    "\n",
    "## Environment \n",
    "The environment is the world of the agent. The agent stays within the environment.\n",
    "For instance, coming back to our chess game, a chessboard is called the environment\n",
    "since the chess player (agent) learns to play the game of chess within the chessboard\n",
    "(environment). Similarly, in Super Mario Bros, the world of Mario is called the\n",
    "environment.\n",
    "\n",
    "## State and action\n",
    "A state is a position or a moment in the environment that the agent can be in. We\n",
    "learned that the agent stays within the environment, and there can be many positions\n",
    "in the environment that the agent can stay in, and those positions are called states.\n",
    "For instance, in our chess game example, each position on the chessboard is called\n",
    "the state. The state is usually denoted by s.\n",
    "\n",
    "The agent interacts with the environment and moves from one state to another\n",
    "by performing an action. In the chess game environment, the action is the move\n",
    "performed by the player (agent). The action is usually denoted by a.\n",
    "\n",
    "\n",
    "## Reward\n",
    "\n",
    "We learned that the agent interacts with an environment by performing an action\n",
    "and moves from one state to another. Based on the action, the agent receives a\n",
    "reward. A reward is nothing but a numerical value, say, +1 for a good action and -1\n",
    "for a bad action. How do we decide if an action is good or bad?\n",
    "In our chess game example, if the agent makes a move in which it takes one of the\n",
    "opponent's chess pieces, then it is considered a good action and the agent receives\n",
    "a positive reward. Similarly, if the agent makes a move that leads to the opponent\n",
    "taking the agent's chess piece, then it is considered a bad action and the agent\n",
    "receives a negative reward. The reward is denoted by r.\n",
    "\n",
    "\n",
    "In the next section, let us explore basic idea of reinforcement learning. "
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
